"""
URL configuration for BiliMili project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import include
from rest_framework import routers

from appeal.views import AppealViewSet, AppealDetailViewSet
from bilimili_django import settings, views
from column.views import ColumnViewSet, ColumnDetailViewSet
from comment.views import CommentViewSet, CommentDetailViewSet, Comment_CommentViewSet, Comment_CommentDetailViewSet
from complaint.views import ComplaintViewSet, ComplaintDetailViewSet
from danmaku.views import DanmakuViewSet
from favor.views import FavorViewSet, FavorDetailViewSet
from follow.views import FollowViewSet, FollowDetailViewSet
from like.views import LikeViewSet, Like_CommentViewSet, Like_Comment_CommentViewSet
from notifications_center.views import NotificationViewSet
from play.views import PlayViewSet, PlayDetailViewSet
from user.views import UserViewSet, UserRegisterViewSet, UserLoginViewSet
from video.views import VideosViewSet, VideosDetailViewSet
from video_reviewing.views import VideosReviewingViewSet

router = routers.DefaultRouter()

router.register(r'api/users', UserViewSet, basename='users')
router.register(r'api/videos', VideosViewSet, basename='videos')
router.register(r'api/videos-detail', VideosDetailViewSet, basename='videos-detail')
router.register(r'api/usersReg', UserRegisterViewSet, basename='usersReg')
router.register(r'api/like', LikeViewSet, basename='like')
router.register(r'api/like_comment', Like_CommentViewSet, basename='like_comment')
router.register(r'api/like_comment_comment', Like_Comment_CommentViewSet, basename='like_comment_comment')
router.register(r'api/favor', FavorViewSet, basename='favors')
router.register(r'api/favor-detail', FavorDetailViewSet, basename='favors-detail')
router.register(r'api/play', PlayViewSet, basename='play')
router.register(r'api/play-detail', PlayDetailViewSet, basename='play-detail')
router.register(r'api/comment', CommentViewSet, basename='comment')
router.register(r'api/comment-detail', CommentDetailViewSet, basename='comment-detail')
router.register(r'api/comment_comment', Comment_CommentViewSet, basename='comment_comment')
router.register(r'api/comment_comment-detail', Comment_CommentDetailViewSet, basename='comment_comment-detail')
router.register(r'api/follow', FollowViewSet, basename='follow')
router.register(r'api/follow-detail', FollowDetailViewSet, basename='follow-detail')
router.register(r'api/column', ColumnViewSet, basename='column')
router.register(r'api/column-detail', ColumnDetailViewSet, basename='column-detail')
router.register(r'api/notifications', NotificationViewSet, basename='notification')
router.register(r'api/videos-reviewing', VideosReviewingViewSet, basename='videos-reviewing')
router.register(r'api/appeal', AppealViewSet, basename='appeal')
router.register(r'api/appeal-detail', AppealDetailViewSet, basename='appeal-detail')
router.register(r'api/complaint', ComplaintViewSet, basename='complaint')
router.register(r'api/complaint-detail', ComplaintDetailViewSet, basename='complaint-detial')
router.register(r'api/danmaku', DanmakuViewSet, basename='danmaku')
from .views import render

urlpatterns = [
                  path('admin/', admin.site.urls),

                  path('', include(router.urls)),

                  path('api/users/infos/<int:user_id>/', UserViewSet.as_view({'get': 'get_user_info'}),
                       name='user_info'),

                  path('api/users/createData/<int:user_id>/<str:date_op>',
                       UserViewSet.as_view({'get': 'get_create_data'}), name='get_create_data'),

                  path('api/users/createData/<int:user_id>/<str:date_op>/<int:choice>',
                       UserViewSet.as_view({'get': 'get_chart_data'}), name='get_chart_data'),

                  path('api/users/datas/<int:mup_id>', UserViewSet.as_view({'get': 'get_mup_data'}),
                       name='get_mup_data'),

                  path('api/like/<str:pk>/<int:user>/count', LikeViewSet.as_view({'get': 'get_like_count'}),
                       name='like-count'),

                  path('api/videos/dynamic/<int:user>/<int:num>/<int:from>/<int:mup>',
                       VideosDetailViewSet.as_view({'get': 'get_dynamic'}), name='dynamic'),

                  path('api/videos/related/<str:type>', VideosDetailViewSet.as_view({'get': 'get_related'}),
                       name='get_related'),

                  # path('videos/postVideo', VideosViewSet.as_view({'post': 'post_video'})),

                  path('api/videos/postVideo/inspect', VideosViewSet.as_view({'post': 'post_video_inspect'}),
                       name='post_video_inspect'),

                  path('api/videos/postVideo/slice', VideosViewSet.as_view({'post': 'post_video_slice'}),
                       name='post_video_slice'),

                  path('api/videos/postVideo/merge', VideosViewSet.as_view({'post': 'post_video_merge'}),
                       name='post_video_merge'),

                  path('api/favor/<str:pk>/<int:user>/count', FavorViewSet.as_view({'get': 'get_favor_count'}),
                       name='favor-count'),

                  path('api/favor-detail/myFavor/<int:user>/<int:num>/<int:from>',
                       FavorDetailViewSet.as_view({'get': 'get_my_favor'}), name='myFavor'),

                  path('api/play/<str:pk>/count', PlayViewSet.as_view({'get': 'get_play_count'}), name='play-count'),

                  path('api/play-detail/history/<int:user_id>/<int:num>/<int:from>',
                       PlayDetailViewSet.as_view({'get': 'get_play_history'}), name='play-history'),

                  path('api/follow/<str:fan>/<int:mup>/count', FollowViewSet.as_view({'get': 'get_follow_count'}),
                       name='follow-count'),

                  path('api/follow/user/<int:user>', FollowViewSet.as_view({'put': 'put_follow'}),
                       name='update_follow'),

                  path('api/follow/myfollow/<int:pk>/<int:choice>', FollowViewSet.as_view({'put': 'put_follow_by_op'}),
                       name='update_follow'),

                  path('api/follow-detail/myFollow/<int:user>/<int:op>/<int:num>/<int:from>',
                       FollowDetailViewSet.as_view({'get': 'get_my_follow'}), name='get_my_follow'),

                  path('api/comment-detail/<str:video_id>/<int:user_id>/<int:num>/<str:already>/<int:option>',
                       CommentDetailViewSet.as_view({'get': 'get_comment'}), name='comment-detail-time'),

                  path('api/comment_comment-detail/<int:comment_id>/<int:user_id>',
                       Comment_CommentDetailViewSet.as_view({'get': 'get_comment_comment'}),
                       name='comment-detail-time'),

                  path('api/api-auth/', include('rest_framework.urls', namespace='rest_framework')),

                  path('api/play/recommend/type/', PlayDetailViewSet.as_view({'get': 'get_recommendations'}),
                       name='recommend'),

                  path('api/play/recommend/toptype/', PlayDetailViewSet.as_view({'get': 'get_top_videos_by_type'}),
                       name='toprecommend'),

                  path('api/notifications/comment', NotificationViewSet.as_view({'post': 'send_comment'}),
                       name='notifications_comment'),

                  path('api/notifications/comment_comment',
                       NotificationViewSet.as_view({'post': 'send_comment_comment'}),
                       name='notifications_comment_comment'),

                  path('api/notifications/like', NotificationViewSet.as_view({'post': 'send_like'}),
                       name='notifications_like'),

                  path('api/notifications/at', NotificationViewSet.as_view({'post': 'send_at'}),
                       name='notifications_like'),

                  path('api/signup', UserRegisterViewSet.as_view({'post': 'create'}), name='signup'),

                  path('api/login/<str:username>/<str:password>', UserLoginViewSet.as_view({'get': 'user_exists'}),
                       name='login'),

                  path('api/play/search/get/', PlayDetailViewSet.as_view({'get': 'search_videos'}), name='searchVideo'),

                  path('api/user/search/', UserViewSet.as_view({'get': 'get_search_result'}), name='searchUser'),

                  path('api/videos/strange/<int:user>', VideosViewSet.as_view({'get': 'get_strange'}),
                       name='get_strange'),

                  path('api/danmaku/read/<str:video>', DanmakuViewSet.as_view({'get': 'get_danmaku'}),
                       name='get_danmaku'),

                  path('api/videos/profile/<int:mup>/<int:num>/<int:from>/<int:type>',
                       VideosDetailViewSet.as_view({'get': 'get_profile'}), name='get_profile'),

                  path('api/user/modify', UserViewSet.as_view({'put': 'modify_user'}), name='modify_user'),

                  path('api/videos/columnWithFavor/<int:coid>/<int:user>',
                       VideosViewSet.as_view({'get': 'get_column_favor'}), name='get_column_favor'),

                  path('api/notifications/videoReviewingNotPass',
                       NotificationViewSet.as_view({'post': 'send_video_reviewing_not_passed'}),
                       name='send_video_reviewing_not_passed'),

                  path('api/notifications/videoReviewingPass',
                       NotificationViewSet.as_view({'post': 'send_video_reviewing_passed'}),
                       name='send_video_reviewing_passed'),

                  path('api/notifications/columnCreated', NotificationViewSet.as_view({'post': 'send_column_created'}),
                       name='send_column_created'),

                  path('api/notifications/videoComplaintPass',
                       NotificationViewSet.as_view({'post': 'send_video_complaint_pass'})),
                  path('api/notifications/columnComplaintPass',
                       NotificationViewSet.as_view({'post': 'send_column_complaint_pass'})),

                  path('api/notifications/videoComplaintNotPass',
                       NotificationViewSet.as_view({'post': 'send_video_complaint_not_pass'})),
                  path('api/notifications/columnComplaintNotPass',
                       NotificationViewSet.as_view({'post': 'send_column_complaint_not_pass'})),

                  path('api/notifications/columnAppeal', NotificationViewSet.as_view({'post': 'send_column_appeal'})),
                  path('api/notifications/videoAppeal', NotificationViewSet.as_view({'post': 'send_video_appeal'})),

                  path('api/notifications/columnChange', NotificationViewSet.as_view({'post': 'send_column_change'}),
                       name='send_column_change'),
                  path('api/notifications/videoChange', NotificationViewSet.as_view({'post': 'send_video_change'}),
                       name='send_video_change'),
                  path('api/notifications/sendFan', NotificationViewSet.as_view({'post': 'sentFan'}), name='sentFan'),
                  path('api/notifications/redRender/<int:user>',
                       NotificationViewSet.as_view({'get': 'get_checked_message_num'}), name='get_checked_message_num'),
                  path('api/notifications/redPut/<int:user>/<str:type>',
                       NotificationViewSet.as_view({'put': 'put_checked_message_num'}), name='put_checked_message_num'),

              ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
